<<<<<<< HEAD
import axios from "../config.js";

/**
 * 分页查询商品
 * @returns {Promise<unknown>}
 */
export const findPage = data => {
  return axios({
    url: "/product/findPage",
    method: "get",
    params: data
  });
};

/**
 * 查询所有商品
 * @returns {Promise<unknown>}
 */
export const findAll = data => {
  return axios({
    url: "/product/findAll",
    method: "get",
    params: data
  });
};

/**
 * 通过商品姓名分页查询
 * @returns {Promise<unknown>}
 */
export const findPageByName = data => {
  return axios({
    url: "/product/findPageByName",
    method: "get",
    params: data
  });
};

/**
 * 添加商品
 * @param data
 * @returns {Promise<unknown>}
 */
export const add = data => {
  return axios({
    url: "/product/add",
    method: "post",
    data
  });
};

/**
 * 更新商品信息
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const update = data => {
  return axios({
    url: "/product/update/" + data.id,
    method: "put",
    data
  });
};

/**
 * 删除商品
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const delProduct = data => {
  return axios({
    url: "/product/delete/" + data,
    method: "delete"
  });
};

/**
 * 删除选中商品
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const delMore = data => {
  return axios({
    url: "/product/deleteMore?ids=" + data,
    method: "delete"
  });
};
=======
import axios from "../config.js";

/**
 * 分页查询商品
 * @returns {Promise<unknown>}
 */
export const findPage = data => {
  return axios({
    url: "/product/findPage",
    method: "get",
    params: data
  });
};

/**
 * 查询所有商品
 * @returns {Promise<unknown>}
 */
export const findAll = data => {
  return axios({
    url: "/product/findAll",
    method: "get",
    params: data
  });
};

/**
 * 通过商品姓名分页查询
 * @returns {Promise<unknown>}
 */
export const findPageByName = data => {
  return axios({
    url: "/product/findPageByName",
    method: "get",
    params: data
  });
};

/**
 * 添加商品
 * @param data
 * @returns {Promise<unknown>}
 */
export const add = data => {
  return axios({
    url: "/product/add",
    method: "post",
    data
  });
};

/**
 * 更新商品信息
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const update = data => {
  return axios({
    url: "/product/update/" + data.id,
    method: "put",
    data
  });
};

/**
 * 删除商品
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const delProduct = data => {
  return axios({
    url: "/product/delete/" + data,
    method: "delete"
  });
};

/**
 * 删除选中商品
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const delMore = data => {
  return axios({
    url: "/product/deleteMore?ids=" + data,
    method: "delete"
  });
};
>>>>>>> origin/master
